<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="bp" value="${pageContext.request.contextPath}" scope="application"></c:set>
<html>
<head>
    <title>用户信息列表</title>
</head>
<body>
    <h2>用户信息列表</h2>
    <a href="${bp}/add.jsp">添加</a>
    <table border="1px" cellspacing="0" width="100%">
        <tr>
            <th>ID</th>
            <th>用户名</th>
            <th>年龄</th>
            <th>邮箱</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${users}" var="user">
            <tr>
                <td>${user.id}</td>
                <td>${user.name}</td>
                <td>${user.age}</td>
                <td>${user.email}</td>
                <td>
                    <a href="${bp}/user/toEdit?id=${user.id}">编辑</a>
                    <a href="${bp}/user/delete?id=${user.id}">删除</a>
                </td>
            </tr>
        </c:forEach>
    </table>
</body>
</html>
